<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的文档管理系统</title>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">
<%@include file="/inc/inc.jsp" %>   
</head>
<body>
<script type="text/javascript">
$(function(){
	var formParam = {
			url : '${pageContext.request.contextPath}/login.action',
			success : function(result) {
				console.info(result);
				var r = $.parseJSON(result);
				if (r.length>0) {
					window.location.href="./WBB-INF/jsp/index.jsp";
					/*$('#user_login_loginDialog').dialog('close');

					$('#sessionInfoDiv').html(formatString('[<strong>{0}</strong>]，欢迎你！您使用[<strong>{1}</strong>]IP登录！', r.obj.loginName, r.obj.ip));

					$('#layout_east_onlineDatagrid').datagrid('load', {});*/
				} else {
					$.messager.show({
						title : '提示',
						msg : '<span style="color:red;">'+r[0].username+'</span>'
					});
				}
			}
		};

		//$('#user_login_loginInputForm').form(formParam);
		$('#user_login_loginDialog').show().dialog({
			modal : true,
			title : '系统登录',
			closable : false,
			buttons : [ {
				text : '注册',
				handler : function() {
					//$('#user_reg_regDialog').dialog('open');
				}
			}, {
				text : '登录',
				handler : function() {
					$('#user_login_loginInputForm').submit();
					$('#user_login_loginDialog').dialog('close');
				}
			} ]
		});
});
</script>
<div id="user_login_loginDialog" style="display: none;width: 300px;height: 210px;overflow: hidden;">
	<div align="center">
				<form method="post" id="user_login_loginInputForm" action="${pageContext.request.contextPath}/login.action">
					<table class="tableForm">
						<tr>
							<th>登录名</th>
							<td><input name="name" class="easyui-validatebox" data-options="required:true" value="admin" />
							</td>
						</tr>
						<tr>
							<th>密码</th>
							<td><input type="password" name="pwd" class="easyui-validatebox" data-options="required:true" style="width: 150px;" value="123" /></td>
						</tr>
					</table>
				</form>
			</div>
</div>
<!-- <form action="./login.action" method="post">
<input type="text" name="name" value="admin" /><input type="text" name = "pwd" value="123"/>
<input type="submit" value="登陆"/>
</form>-->
</body>
</html>